package vfs.obj.association;


import vfs.except.VFSException;
import vfs.filter.VFSFilter;
import vfs.obj.entity.VFSGroup;
import vfs.obj.entity.VFSNode;
import java.util.Iterator;

/**
 * VFSNodeReadableByGroup is an association manipulator capable of 
 * manipulating the "readable by" relationship between Nodes and Groups.
 * 
 * @author Matthew Eavenson <durandal@uga.edu>
 */
public interface VFSNodeReadableByGroup{

    /**
     * Returns an iterator over all nodes readable by a specified group,
     * and filtered by a specified filter.
     * 
     * @param group the group that can read the requested nodes
     * @param filter a filter over the nodes readable by the specified group
     * @return an iterator over any matching nodes
     */
    Iterator<VFSNode> getNodes(VFSGroup group, VFSFilter filter) throws VFSException;
    
    /**
     * Returns the read group of a specified node.
     * 
     * @param node the node whose read group is requested
     * @return the read group of the specified node
     */
    VFSGroup getGroup(VFSNode node) throws VFSException;
    
    /**
     * Sets the read group of a specified node to a specified group.
     * 
     * @param node the node whose read group will be set
     * @param group the group to set as the read group of the specified node
     */
    void setGroup(VFSNode node, VFSGroup group) throws VFSException;
    
}
